{% extends "base_facebook.html" %}
{% block title %}Thanks for entering{% endblock %}
{% block body %}thanks{% endblock %}

{% block page_content %}
    <header class="tab-header">
        <h1><b>WIN</b> a {{ competition.university.name }} Graduate Hoody</h1>
    </header>
    <section class="app-content">
        <div class="highlighted">
            <p>
                To celebrate the launch of our new Graduate range, we’re giving away
                10 {{ competition.university.name }} Graduate hoodies absolutely free.
            </p>
        </div>
        <p>
            Simply enter the prize draw below and we’ll randomly select 2 
            winners every fortnight from {{ competition.opening_date|date:"l jS M" }}. Good luck!
        </p>
        <span class="arrow-seperator"></span>
        <section id="testimonials" class="module-box hoody-box">
            <header class="top">
                <h3>Entry form</h3>
            </header>
            <section class="content" style="background-image: url({{ settings.MEDIA_URL }}{{ competition.university.entryImage }});">
                <div class="highlighted">
                    <p>
                        You were entered into the prize draw.
                    </p>
                    <p>
                        Good luck!
                    </p>
                </div>
                <a class="share">share</a>
            </section>
        </section>
    </section>
{% endblock page_content %}

{% block footer_script %}
<div id="fb-root"></div>
<script src="//connect.facebook.net/en_US/all.js"></script>
<script>
    FB._https = true;
    FB.init({
        appId  : '{{ competition.app_id }}',
        status : false,
        cookie : false,
        xfbml  : true
    });

    window.fbAsyncInit = function() {
        FB.Canvas.setAutoGrow();
    }

    //click for fb dialog in global.js
    /*
     * shareClick is invoked (from globals.js) when the .share-link is clicked.
     */
    function shareClick(){
        FB.ui( {
            {% include "facebook/templates/_share.html" %}
        });
    }

    function scrollTop(){
        FB.Canvas.scrollTo(0,0);
    }
    
    $('a.share').click(function(){
        shareClick();
    });

    $(document).ready(function(){
    	scrollTop();
    });

</script>
{% endblock footer_script %}
